package com.z.xviewpager.xviewpager;


import android.view.View;
import android.view.ViewGroup;

/**
 * Created by z
 * on 2017/11/19 0019.
 */

public abstract class XAdapter {

    public abstract View getView(int position, View convertView, ViewGroup parent);

    public abstract int getSize();

    public int getPreviousPosition(int position) {
        return position <= 0 ? -1 : position - 1;
    }

    public int getNextPosition(int position) {
        return position >= getSize() - 1 ? -1 : position + 1;
    }

}
